/* page.tsx spboucher.ai Web Author: Simon-Pierre Boucher Mail: contact@spboucher.ai */ import type { Metadata } from "next"; import Image from "next/image"; import Link from "next/link"; import { notFound } from "next/navigation"; import { ArrowLeft, ArrowRight, CalendarDays, Clock, Mail, } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { BlogContent } from "@/components/blog-content"; import { Reveal } from "@/components/reveal"; import { getBlogPost, getBlogPosts, getBlogSlugs } from "@/lib/blog"; interface PageProps { params: Promise<{ slug: string }>; } export function generateStaticParams() { return getBlogSlugs().map((slug) => ({ slug })); } export async function generateMetadata({ params, }: PageProps): Promise { const { slug } = await params; const post = getBlogPost(slug); if (!post) return {}; return { title: post.title, description: post.excerpt, openGraph: { title: post.title, description: post.excerpt, type: "article", publishedTime: post.date, authors: ["Simon-Pierre Boucher"], }, }; } function AuthorSignature({ compact = false }: { compact?: boolean }) { return (
Portrait of Simon-Pierre Boucher

Simon-Pierre Boucher

{!compact && (

Professor — Department of Administrative Sciences, UQO

)}
); } export default async function BlogPostPage({ params }: PageProps) { const { slug } = await params; const post = getBlogPost(slug); if (!post) notFound(); const posts = getBlogPosts(); const index = posts.findIndex((p) => p.slug === slug); const previous = index > 0 ? posts[index - 1] : undefined; const next = index < posts.length - 1 ? posts[index + 1] : undefined; return (
{/* Header */}
Essay {post.tags.map((tag) => ( {tag} ))}

{post.title}

{/* Body */} {/* Signature */}

{/* Prev / next */} {(previous || next) && ( )}
); }